<template>
	<view id="app">
		<!-- 全局加载提示 -->
		<view v-if="globalLoading" class="global-loading">
			<text>加载中...</text>
		</view>
	</view>
</template>

<script>
	import { getToken } from '@/utils/auth.js'
	
	export default {
		data() {
			return {
				globalLoading: false
			}
		},
		onLaunch: function() {
			console.log('App Launch')
			this.checkLogin()
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			// 检查登录状态
			checkLogin() {
				const token = getToken()
				if (token) {
					console.log('用户已登录')
				} else {
					console.log('用户未登录')
				}
			}
		}
	}
</script>

<style>
	/* 全局样式 */
	page {
		background-color: #f5f5f5;
	}
	
	/* 全局加载样式 */
	.global-loading {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.5);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 9999;
		color: #fff;
		font-size: 28rpx;
	}
	
	/* 通用按钮样式 */
	.btn-primary {
		background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
		color: #fff;
		border-radius: 8rpx;
		border: none;
	}
	
	.btn-primary::after {
		border: none;
	}
	
	/* 通用卡片样式 */
	.card {
		background: #fff;
		border-radius: 12rpx;
		box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
	}
	
	/* 通用输入框样式 */
	.input {
		background: #f8f9fa;
		border-radius: 8rpx;
		border: 2rpx solid transparent;
		transition: all 0.3s;
	}
	
	.input:focus {
		background: #fff;
		border-color: #667eea;
	}
	
	/* 通用文本样式 */
	.text-primary {
		color: #667eea;
	}
	
	.text-success {
		color: #52c41a;
	}
	
	.text-warning {
		color: #fa8c16;
	}
	
	.text-danger {
		color: #ff4d4f;
	}
	
	.text-muted {
		color: #999;
	}
</style>
